{$CLEO .cs}


$Sweet_Car = 0
023C: load_special_actor 'psycho' as 1 // models 290-299
038B: load_requested_models
32@ = 0
33@ = 0

if
023D:   special_actor 1 loaded

then
jump @to 


end
0ACD: show_text_highpriority "~r~Loading Luigi's Failed!" time 3000
end_thread

:respawn 
wait 0
if
32@ >= 15000
jf @wait 
32@ = 0
023C: load_special_actor 'psycho' as 1 // models 290-299
038B: load_requested_models
Jump @to
:wait 
if 
$onmission == 0
then

0296: unload_special_actor 1
end_thread
end

jump @respawn
:to
0@ = actor.Create(23, #SPECIAL01, 3920.5974, -973.889, 1638.3688)
actor.Health(0@) = 2000

0446: set_actor 0@ dismemberment_possible 0
33@ = 0
actor.SetWalkStyle(0@ , "player")
actor.SetImmunities(0@,1,1,1,1,1)
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 8 // see ped.dat
//077A: set_actor 0@ acquaintance 4 to_actors_pedtype 23 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 7 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 20 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 6 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 9 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 10 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 11 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 12 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 14 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 13 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 15 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 16 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 24 // see ped.dat
077A: set_actor 0@ acquaintance 4 to_actors_pedtype 25 // see ped.dat
//077A: set_actor 0@ acquaintance 4 to_actors_pedtype 23 // see ped.dat
marker.CreateAboveActor(1@, 0@)
018B: set_marker 1@ radar_mode 4
marker.SetIconSize(1@, 2)
//05E2: AS_actor 0@ kill_actor $player_actor 
05DE: AS_actor 0@ walk_around_ped_path
0A09: set_actor 0@ muted 1 // versionB

7@ = 30.0
8@ = 30.0
9@ = 30.0
32@ = 0
:start_random
wait 0
0209: 18@ = random_int_in_ranges 0 10
if
18@ == 0 
then
00A1: put_actor 0@ at  3812.866 -1051.5018 1637.3688
actor.Angle(0@) = 6.5331
jump @main
end
if
18@ == 1 
then
00A1: put_actor 0@ at   3824.5701 -1007.5818 1637.3688
actor.Angle(0@) =  277.1979
jump @main
end
if
18@ == 2
then
00A1: put_actor 0@ at  3830.6868 -1002.0336 1630.668
actor.Angle(0@) = 278.6042
jump @main
end
if
18@ == 3
then
00A1: put_actor 0@ at  3903.7888 -997.1885 1630.668
actor.Angle(0@) = 269.6042
jump @main
end
if
18@ == 4
then
00A1: put_actor 0@ at  3617.4248 -963.7058 1630.668
actor.Angle(0@) =  181.2184
jump @main
end
if
18@ == 5
then
00A1: put_actor 0@ at  3635.3879 -982.4268 1637.3688
actor.Angle(0@) =  178.3072   
jump @main
end
if
18@ == 6
then
00A1: put_actor 0@ at  3710.834 -1107.662 1630.6909
actor.Angle(0@) =   180.3077
jump @main
end
if
18@ == 7
then
00A1: put_actor 0@ at  3903.7888 -997.1885 1630.668
actor.Angle(0@) = 269.6042
jump @main
end
if
18@ == 8
then
00A1: put_actor 0@ at   3739.5796 -1159.3911 1630.6388
actor.Angle(0@) =   270.0254
jump @main
end
if                //optional basement
18@ == 9
then
00A1: put_actor 0@ at   3679.8452 -1109.2269 1590.1787
actor.Angle(0@) =   1.7751
jump @main
end
jump @start_random



:main
wait 0
04C4: store_coords_to 3@ 4@ 5@ from_actor 0@ with_offset 0.0 0.0 0.0

if  or
$actor_sweet == 0 
$onmission == 0
then



jump @clear_it 
end
:triggers_toys
if
$Sweet_Car >= 7
then
060A: create_decision_maker_type 4 store_to 28@  // decision\allowed\m_.ped files
07E5: copy_decision_maker 28@ to 31@
060B: set_actor 0@ decision_maker_to 31@
7@ = 100.0
8@ = 100.0
9@ = 100.0
end
jump @get
if
056D:   actor 0@  defined
then
:clear_it
0296: unload_special_actor 1

actor.DestroyInstantly(0@)

end
end_thread







:get
0209: 17@ = random_int_in_ranges 0 3
if
17@ == 0
then
0AE1: 30@ = random_actor_near_point 3@ 4@ 5@ in_radius 30.0 find_next 1 pass_deads 1

end
if
17@ == 1
then
30@ = actor.EmulateFromPlayer($PLAYER_CHAR)
end
if
17@ == 2
then

if
056D:   actor $second_player_actor  defined

then
30@ = actor.EmulateFromPlayer($second_player)
end
end
       {
:spot
if
056D:   actor 30@  defined
then
089F: get_actor 30@ pedtype_to 20@
if  and
not 20@ == 17
not 20@ == 23
then
if
0364:   actor 0@ spotted_actor 30@
then

05E2: AS_actor 0@ kill_actor 30@
end    
end
end  }
if and
0364:   actor 0@ spotted_actor $PLAYER_ACTOR
0104:   actor $PLAYER_ACTOR near_actor 0@ radius 30.0 30.0 30.0 sphere 0

then
018B: set_marker 1@ radar_mode 2

end 
if
056D:   actor $second_player_actor  defined
then
if and
0364:   actor 0@ spotted_actor $second_player_actor
0104:   actor $second_player_actor near_actor 0@ radius  30.0 30.0 30.0 sphere 0
then
018B: set_marker 1@ radar_mode 2
end
end
if 
056D:   actor 30@  defined
then
if and
32@ > 12000
0364:   actor 0@ spotted_actor 30@
0104:   actor 30@ near_actor 0@ radius  7@ 8@ 9@ sphere 0
then
089F: get_actor 30@ pedtype_to 20@
if  and
not 20@ == 17
not 20@ == 23
then
32@  = 0                               //NEW!!!!
//0687: clear_actor 0@ task
//0792: disembark_instantly_actor 0@

05E2: AS_actor 0@ kill_actor 30@

end
end
end
if and
056D:   actor 0@  defined 
33@ >= 30000
then                     
if
075C:   marker 1@ enabled

then
marker.Disable(1@)
end
actor.DestroyInstantly(0@)
33@ = 0 
32@ = 10000
wait 1000
jump @respawn 
end


:bomb
if
056D:   actor 30@  defined
then
if and
0364:   actor 0@ spotted_actor 30@
0105:   actor 30@ near_actor 0@ radius 3.0 3.0 3.0 sphere 0 on_foot
then
089F: get_actor 30@ pedtype_to 21@
if  and
not 21@ == 17
not 21@ == 23
then
0948: create_explosion_at 3@ 4@ 5@ type 11 camera_shake 3.0
05BE: AS_actor 30@ die
05BE: AS_actor 0@ die

actor.DestroyInstantly(0@)
32@ = 0

jump @respawn 
end
end
end

if
33@ > 25000
then
33@ = 0
078F: AS_actor 0@ climb 1
05DE: AS_actor 0@ walk_around_ped_path
end
if 
$actor_sweet == 0 
then

jump @goto
end
jump @main

:goto
0296: unload_special_actor 1
0A93: end_custom_thread
0A92: create_custom_thread "battle_maps\airport_luigi.cs"

end_thread